//
//  HHPRequestCache.h
//  HHPLiveVideo
//
//  Created by 韩红坡 on 2016/12/15.
//  Copyright © 2016年 韩红坡. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface HHPRequestCache : NSURLCache

+ (HHPRequestCache *)sharedRequestCache;

/*
 * 检查url请求在缓存中是否存在
 */
- (BOOL)isCached:(NSURL *)url;

/*
 * 删除内存缓存中所有url请求缓存（不影响硬盘缓存）
 */
- (void)removeAllCachedResponsesInMemory;

/**
 *  创建缓存
 *
 *  @param urlRequest a urlRequest
 *  @param responsObj responsObj
 */
- (void)creatDiskCacheForURLRequest:(NSURLRequest *)urlRequest
                        responseObj:(id)responsObj;

/**
 *  获取缓存
 *
 *  @param urlRequest currentRequest
 *
 *  @return responseObj
 */
- (id)diskCacheForURLRequest:(NSURLRequest *)urlRequest;


@end
